/**
 * merge level=50
 * 
 * 选择界面theme的一个小方框,鼠标移上去会显示tooltip,单击由写处当前theme到cookies,然后刷新页面
 */
Ext.define('Jfok.shared.ThemeSelectPanel', {
	extend : 'Ext.panel.Panel',
	alias : 'widget.themeselectpanel',
	border : false,
	margin : '1 1 1 1',
	width : 11,
	height : 11,
	theme : null,
	themetext : null,
	listeners : {
		afterrender : function(scope) {
			Ext.create('Ext.tip.ToolTip', {
				target : this.id,
				html : '界面主题:' + this.themetext
			});
			var el = Ext.get(this.id);
			el.on('click', function() {
				Cookies.set('theme' , scope.theme , 365);
				location.reload(true);
			});
			el.addClsOnOver('theme-select-over');
		}
	}
});


/**
 * 选择界面theme的控件，里面有4个ThemeSelect
 */
Ext.define('Jfok.shared.ThemeSelect', {
	extend : 'Ext.panel.Panel',
	alias : 'widget.themeselect',
	margin : '0 3 0 0',
	bodyStyle : 'background:#cde; padding:0px;',
	border : false,
	height : 26,
	width : 26,
	layout : {
		type : 'table',
		columns : 2
	},

	initComponent : function() {
		this.defaults = {
			xtype : 'themeselectpanel'
		};
		this.items = [ {
			baseCls : 'theme-neptune',
			theme : 'neptune',
			themetext : '现代气息'
		}, {
			baseCls : 'theme-classic',
			theme : 'classic',
			themetext : '淡蓝色'

		}, {
			baseCls : 'theme-gray',
			theme : 'gray',
			themetext : '浅灰色'
		}, {
			baseCls : 'theme-steelblue',
			theme : 'steelblue',
			themetext : '深棕色'
		} ];

		this.callParent(arguments);
	}

});